using System;
using System.Windows;
using Client.Common;

namespace ClientUI.Model
{
    public class TrackerItem
    {
        public DateTime CreatedOn { get; private set; }

        public TrackerItem()
        {
            CreatedOn = DateTime.Now;
        }

        public string ItemUid { get; set; }
        public string ItemCode { get; set; }
        public string ItemTitle { get; set; }

        public bool IsProcessed { get; set; }

        public void SetInfoMessage(string message)
        {
            IsError = false;
            Message = message;
        }

        public void SetErrorMessage(string message)
        {
            IsError = true;
            Message = message;
        }

        public bool IsError { get; private set; }
        public string Message { get; private set; }

        public Style MessageStyle
        {
            get
            {
                return IsError ? DynamicStyleProvider.ListItemTextBlockErrorStyle() : DynamicStyleProvider.ListItemTextBlockMessageStyle();
            }
        }

    }
}